#include "player.h"

Player::Player(QObject *parent) : QObject(parent) { }

Player::Player(QString name, QObject *parent) : Player(parent){
    m_name = name;
}

void Player::setName(QString name){
    m_name = name;
}
QString Player::getName(){
    return m_name;
}

// 设置 / 获取角色：地主 / 农民
void Player::setRole(Role role){
    m_role = role;
}
Player::Role Player::getRole(){
    return m_role;
}

void Player::setSex(Sex sex){
    m_sex = sex;
}
Player::Sex Player::getSex(){
    return m_sex;
}

void Player::setDirection(Direction direction){
    m_direction = direction;
}
Player::Direction Player::getDirection(){
    return m_direction;
}

void Player::setType(Type type){
    m_type = type;
}
Player::Type Player::getType(){
    return m_type;
}

void Player::setScore(int score){
    m_score = score;
}
int Player::getScore(){
    return m_score;
}

void Player::setWin(bool flag){
    m_isWin = flag;
}

bool Player::isWin(){
    return m_isWin;
}

void Player::setPrevPlayer(Player *player){
    m_prev = player;
}
Player *Player::getPrevPlayer(){
    return m_prev;
}

void Player::setNextPlayer(Player *player){
    m_next = player;
}
Player *Player::getNextPlayer(){
    return m_next;
}

void Player::grabLordBet(int point){
    emit notifyGrabLordBet(this, point);
}

void Player::storeDispatchCard(const Card &card){
    m_cards.add(card);
    Cards cs;
    cs.add(card);
    emit notifyPickCards(this, cs);
}
void Player::storeDispatchCard(const Cards &cards){
    m_cards.add(cards);
    emit notifyPickCards(this, cards);
}

Cards Player::getCards(){
    return m_cards;
}
void Player::clearCards(){
    m_cards.clear();
}

void Player::playHand(const Cards &cards){
    m_cards.remove(cards);
    emit notifyPlayHand(this, cards);
}

Player *Player::getPendPlayer(){
    return m_pendPlayer;
}
Cards Player::getPendCards(){
    return m_pendCards;
}
void Player::storePendingInfo(Player *player, const Cards &cards){
    m_pendPlayer = player;
    m_pendCards = cards;
}

void Player::prepareCallLord(){ }

void Player::preparePlayHand() { }

void Player::thinkCallLord() { }

void Player::thinkPlayHand() { }
